<HTML><HEAD><TITLE>NanoEngine.js</TITLE></HEAD><BODY>
<A NAME="_top_"></A><PRE><A HREF="index.html">Index Files</A> </PRE><HR/>
<H1>File NanoEngine.js</H1>
 Class that provides a tiny AJAX engine. <P><DL><DT><B>Author:</B></DT><DD>Carlos Eduardo Goncalves</DD></DL></P>
<HR/>
<A HREF=#NanoEngine>NanoEngine</A><BR/>
<A HREF=#NanoEngine.debug >NanoEngine.debug </A><BR/>
<A HREF=#NanoEngine.messages >NanoEngine.messages </A><BR/>
<A HREF=#NanoEngine.ACTIVEX_XHR >NanoEngine.ACTIVEX_XHR </A><BR/>
<A HREF=#NanoEngine.HTTP_METHODS >NanoEngine.HTTP_METHODS </A><BR/>
<A HREF=#NanoEngine.HTTP_STATUS_CODES >NanoEngine.HTTP_STATUS_CODES </A><BR/>
<A HREF=#NanoEngine.reportException>NanoEngine.reportException</A><BR/>
<A HREF=#NanoEngine.removeMessage>NanoEngine.removeMessage</A><BR/>
<A HREF=#NanoEngine.buildActiveX>NanoEngine.buildActiveX</A><BR/>
<A HREF=#NanoEngine.buildRequest>NanoEngine.buildRequest</A><BR/>
<A HREF=#NanoEngine.createMessage>NanoEngine.createMessage</A><BR/>
<A HREF=#NanoEngine.sendMessage>NanoEngine.sendMessage</A><BR/>
<A HREF=#NanoEngine.wrapMessage>NanoEngine.wrapMessage</A><BR/>
<A HREF=#NanoEngine.parseStatus>NanoEngine.parseStatus</A><BR/>
<HR/>
<A NAME=NanoEngine></A>
<H2>Constructor NanoEngine</H2><PRE>function NanoEngine(debug)</PRE>  <p>Nano AJAX engine class constructor.</p> <P><TABLE WIDTH="90%" BORDER=1><TR BGCOLOR=#BDB3C4><TD><B>Parameter</B></TD><TD><B>Description</B></TD></TR><TR><TD><I>debug</I></TD><TD><code>Boolean</code> flag that turns on/off the engine debug mode.</TD></TR></TABLE></P><BR/><BR/>
<A NAME=NanoEngine.debug ></A>
<H2> Attribute NanoEngine.debug </H2><PRE>NanoEngine.debug </PRE> <p>Debug mode flag.</p> <P></P><BR/><BR/>
<A NAME=NanoEngine.messages ></A>
<H2> Attribute NanoEngine.messages </H2><PRE>NanoEngine.messages </PRE> <p>Array that holds all active messages.</p> <P></P><BR/><BR/>
<A NAME=NanoEngine.ACTIVEX_XHR ></A>
<H2> Attribute NanoEngine.ACTIVEX_XHR </H2><PRE>NanoEngine.ACTIVEX_XHR </PRE> <p>ActiveX classes that provide XMLHttpRequest features.</p> <P></P><BR/><BR/>
<A NAME=NanoEngine.HTTP_METHODS ></A>
<H2> Attribute NanoEngine.HTTP_METHODS </H2><PRE>NanoEngine.HTTP_METHODS </PRE> <p>HTTP supported methods.</p> <P></P><BR/><BR/>
<A NAME=NanoEngine.HTTP_STATUS_CODES ></A>
<H2> Attribute NanoEngine.HTTP_STATUS_CODES </H2><PRE>NanoEngine.HTTP_STATUS_CODES </PRE> <p>HTTP status codes.</p> <P></P><BR/><BR/>
<A NAME=NanoEngine.reportException></A>
<H2> Method NanoEngine.reportException</H2><PRE>NanoEngine.reportException = function(msg_id, exception)</PRE>  <p>Define the way how exceptions are reported.</p> <P><TABLE WIDTH="90%" BORDER=1><TR BGCOLOR=#BDB3C4><TD><B>Parameter</B></TD><TD><B>Description</B></TD></TR><TR><TD><I>msg_id</I></TD><TD>Unique identifier for a message on messages array. </TD></TR><TR><TD><I>exception</I></TD><TD>Exception to be displayed or threw. </TD></TR></TABLE><DL><DT><B>Throws:</B></DT><DD>Run time exception.</DD></DL></P><BR/><BR/>
<A NAME=NanoEngine.removeMessage></A>
<H2> Method NanoEngine.removeMessage</H2><PRE>NanoEngine.removeMessage = function(msg_id)</PRE>  <p>Remove an AJAX message from the queue.</p> <P><TABLE WIDTH="90%" BORDER=1><TR BGCOLOR=#BDB3C4><TD><B>Parameter</B></TD><TD><B>Description</B></TD></TR><TR><TD><I>msg_id</I></TD><TD>Unique identifier for a message on messages array.</TD></TR></TABLE></P><BR/><BR/>
<A NAME=NanoEngine.buildActiveX></A>
<H2> Method NanoEngine.buildActiveX</H2><PRE>NanoEngine.buildActiveX = function(names)</PRE>  <p>Try to build an ActiveX object based on a list classes.</p> <P><TABLE WIDTH="90%" BORDER=1><TR BGCOLOR=#BDB3C4><TD><B>Parameter</B></TD><TD><B>Description</B></TD></TR><TR><TD><I>names</I></TD><TD>Array with ActiveX class names that could be created. </TD></TR></TABLE><DL><DT><B>Returns:</B></DT><DD>Reference to an <code>ActiveXObject</code>.</DD></DL></P><BR/><BR/>
<A NAME=NanoEngine.buildRequest></A>
<H2> Method NanoEngine.buildRequest</H2><PRE>NanoEngine.buildRequest = function()</PRE>  <p>Build client side JavaScript objects required to XMLHTTP request.</p> <P><DL><DT><B>Returns:</B></DT><DD>Reference to a <code>XMLHttpRequest</code> or <code>ActiveXObject</code> instance.</DD></DL></P><BR/><BR/>
<A NAME=NanoEngine.createMessage></A>
<H2> Method NanoEngine.createMessage</H2><PRE>NanoEngine.createMessage = function(url, consumer, onError, onChange, onComplete)</PRE> <p>Create a message setting all properties.</p> <P><TABLE WIDTH="90%" BORDER=1><TR BGCOLOR=#BDB3C4><TD><B>Parameter</B></TD><TD><B>Description</B></TD></TR><TR><TD><I>url</I></TD><TD>Url to access. </TD></TR><TR><TD><I>consumer</I></TD><TD>Consumer id. </TD></TR><TR><TD><I>onError</I></TD><TD>Function that should be called at the onError event. </TD></TR><TR><TD><I>onChange</I></TD><TD>Function that should be called at the onChange event. </TD></TR><TR><TD><I>onComplete</I></TD><TD>Function that should be called at the onComplete event. </TD></TR></TABLE><DL><DT><B>Returns:</B></DT><DD>New message instance.</DD></DL></P><BR/><BR/>
<A NAME=NanoEngine.sendMessage></A>
<H2> Method NanoEngine.sendMessage</H2><PRE>NanoEngine.sendMessage = function(msg)</PRE>  <p>Send a message after add it to messages array.</p> <P><TABLE WIDTH="90%" BORDER=1><TR BGCOLOR=#BDB3C4><TD><B>Parameter</B></TD><TD><B>Description</B></TD></TR><TR><TD><I>msg</I></TD><TD>Object that represent the message to send. </TD></TR></TABLE><DL><DT><B>Returns:</B></DT><DD>Unique id generated by the engine for the message. </DD></DL><DL><DT><B>See:</B></DT><DD>Connection.sendMessage(Message)</DD></DL></P><BR/><BR/>
<A NAME=NanoEngine.wrapMessage></A>
<H2> Method NanoEngine.wrapMessage</H2><PRE>NanoEngine.wrapMessage = function(msg)</PRE>  <p>Import all AJAX message data to the wrapper.</p> <P><TABLE WIDTH="90%" BORDER=1><TR BGCOLOR=#BDB3C4><TD><B>Parameter</B></TD><TD><B>Description</B></TD></TR><TR><TD><I>msg</I></TD><TD>Object that represents the message to be wrapped.	 </TD></TR></TABLE><DL><DT><B>Returns:</B></DT><DD>Object that represents the message wrapper. </DD></DL><DL><DT><B>See:</B></DT><DD>MessageWrapper.wrap(Message)</DD></DL></P><BR/><BR/>
<A NAME=NanoEngine.parseStatus></A>
<H2> Method NanoEngine.parseStatus</H2><PRE>NanoEngine.parseStatus = function(status)</PRE> <p>Return user friendly HTTP status code.</p> <P><TABLE WIDTH="90%" BORDER=1><TR BGCOLOR=#BDB3C4><TD><B>Parameter</B></TD><TD><B>Description</B></TD></TR><TR><TD><I>status</I></TD><TD>Status code. </TD></TR></TABLE><DL><DT><B>Returns:</B></DT><DD><code>String</code> with the request status and its definition.</DD></DL></P><BR/><BR/>
</BODY></HTML>
